#include<stdio.h>
struct js{
    char name[30];
    int xb;
    int old;
};
struct js pep[20];
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        char *name;
        int xb;
        int old;
        scanf("%s",pep[i].name);
        scanf("%d",&xb);
        scanf("%d",&old);
        pep[i].old=old;
         pep[i].xb=xb;
    }
    printf("%s ",pep[n/2].name);
    if(pep[n/2].xb){
        printf("Male ");
    }
    else {
        printf("Female ");
    }
    printf("%d",pep[n/2].old);
    return 0;
}
